Skip to content

Remove Metadata Importing Requirements for External References and Signatures - #655

Merged
Washi1337 merged 8 commits into
developmentfrom
feature/auto-import
Sep 8, 2025
Merged

Remove Metadata Importing Requirements for External References and Signatures#655
Washi1337 merged 8 commits into
developmentfrom
feature/auto-import

Conversation

@Washi1337

@Washi1337 Washi1337 commented Jul 6, 2025

Copy link
Copy Markdown
Owner

This is a breaking change that aims to make generating CIL code and .NET metadata easier.

Features:

  • Remove requirement for importing TypeReferences and MemberReferences.
  • Split IModuleProvider::Module into ContextModule and DeclaringModule.
  • IResolutionScope::CreateTypeReference automatically sets the context module for more predictable type resolution.
  • Add IMemberDefinition::Resolve(ModuleDefinition) overloads taking a module definition as overriding resolution context.

This should avoid the very common problem that people run into when forgetting to import a reference and not knowing which reference was not imported exactly. It should also remove any confusion of the meaning of the Module property in metadata members that represent external references (i.e., is Module the module that owns the reference or the module the definition behind the reference is defined in?). Note that definitions (e.g., TypeDefinition) still need to be imported explicitly, to convert them to the appropriate references (i.e., TypeReference).

@Washi1337 Washi1337 added enhancement dotnet Issues related to AsmResolver.DotNet labels Jul 6, 2025
@Washi1337 Washi1337 added this to the 6.0.0 milestone Jul 6, 2025
@Washi1337
Washi1337 marked this pull request as draft July 8, 2025 14:02
@Washi1337
Washi1337 marked this pull request as ready for review September 6, 2025 21:20
@Washi1337
Washi1337 merged commit 69220e9 into development Sep 8, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dotnet Issues related to AsmResolver.DotNet enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant